<template>
    <el-dialog title="新增" v-model="editFormVisible" :close-on-click-modal="false">
        <el-form ref="form" :model="form" :rules="rules" label-width="110px">
            <el-form-item label="问题描述">
                <el-input :autosize="{ minRows: 2}"  type="textarea" v-model="form.FContent"></el-input>
            </el-form-item>
            <el-form-item label="提交日期">
                <el-date-picker type="date" placeholder="选择日期" v-model="form.FSubmitDate"  style="width: 100%"></el-date-picker>
            </el-form-item>
            <el-form-item label="问题解决情况">
                <el-input :autosize="{ minRows: 2}"  type="textarea" v-model="form.FReply"></el-input>
            </el-form-item>
            <el-form-item label="解决日期">
                <el-date-picker type="date" placeholder="选择日期" v-model="form.FEndDate"  style="width: 100%"></el-date-picker>
            </el-form-item>            <el-form-item label="处理人">
                <sy-select  v-model="form.FUserID"
                            optionData="server/system/User.ashx?cmd=GetUserOptions">
                </sy-select>
            </el-form-item>
            <el-form-item label="附件">
                <sy-card-upload v-model="form.FPic">
                </sy-card-upload>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click.native="editFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="save" :loading="loading">保存</el-button>
        </div>
    </el-dialog>
</template>

<script>
    import util from '../../common/util'
    import mixin from '../../common/mixin'
    export default {
        mixins: [mixin],
        data() {
            return {
                form: {},
                rules: {

                },
                loading:false,
                editFormVisible:false
            }
        },
        methods: {
            _openEdit(record) {
                this.editFormVisible = true;
                this.form = Object.assign({},record);
            },
            _openAdd() {
                this.editFormVisible = true;
                this.form = {FID:0};
            },
            save:function () {
                let url = "server/other/ServiceProblem.ashx?cmd=Save"
                util.saveForm(url,this.$refs.form,this.form,this.loadFn("loading"),result=> {
                    util.msgSuc("保存成功")
                    this.editFormVisible = false
                    this.$emit("onSaveSuc",this.form)
                })
            }
        },
        created() {

        }
    }
</script>
